<?php
if( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * 下拉框项model层
 * @author Toby.Tu 2016-09-02
 */
class Picklist_model extends My_Model{
    public $tab = 'picklist';
    public $pk = 'id';
    /**
     * 获取对应的下拉框项
     * @author Toby.tu 2017-03-01
     */
    public function getOptsByName($name=''){
        if(empty($name)) return array();
        $this->select('*')->where('name',$name)->where('is_start',1)->order_by('sort');
        $rows = $this->get('opts_key');
        if(!empty($rows)){
            return $rows;
        }
        return array();
    }
}
